<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>

import res from "core-js/internals/is-forced";

export default {
  name: 'App',
  components: {},
  data(){
    return {
      //user:JSON.parse(localStorage.getItem("jwtToken"))//获取token
      user:JSON.parse(sessionStorage.getItem("CurUser"))
    }
  },
  watch:{
    '$store.state.menu':{
      handler(val,old){//监听菜单变化
        console.log(val,old)
        if (!old && this.user && this.user.no){
          this.$store.commit("setRouter",val)
        }
      },
      immediate:true
    }
  }
}
</script>

<style>
#app {
    height: 100%;
}
</style>
